/**
 * Copyright (C) 2018 - 2020 https://github.com/LeeYan9
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bifrost.entity;

import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author Lee
 * Create Class on 2018/8/15
 * @com.bifrost.entity
 * @wechat-mall
 */
@Entity
@Table(name = "BONUS_POINTS_STORE")
@Data
public class BonusPointsStore extends BaseEntity implements Serializable{

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "BONUS_POINTS_STORE_ID", unique = true, nullable = false)
    private Long BonusPointsStoreId;

    @Column(name = "MAIN_NAME" ,columnDefinition = "varchar(128) DEFAULT NULL COMMENT '积分活动名称'")
    private String name ;
    @Column(name = "DESCRIPTION" ,columnDefinition = "varchar(255) DEFAULT NULL COMMENT '积分活动描述'")
    private String description;
    @Column(name = "MAIN_KEY" ,columnDefinition = "varchar(128) DEFAULT NULL COMMENT '积分Key区别'")
    private String key;
    @Column(name = "BONUS_POINTS_RATIO" ,columnDefinition = "int(11) DEFAULT NULL COMMENT '积分点'")
    private String bonusPointsRatio; //积分比率

    @Enumerated(value = EnumType.STRING)
    @Column(name = "BONUS_POINTS_STORE_TYPE")
    private BonusPointsStoreType bonusPointsStoreType=BonusPointsStoreType.REGISTER;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "MERCHANT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private MerchantStore merchantStore;

}
